Linux time zone details and common time functions time and time zone The entire earth is divided into 24 time zones, each time zone has its own local time. ø UTC Time and GMT time We can think of Greenwich Mean Time (GMT = UTC), GMT and
Recently, I fixed a cross-Time Zone bug in the project. To fix this bug, it really takes a lot of effort. It seems that the main reason is that the development tasks do not involve this concept in normal times, and the test case for testing the
1. Check the current time zoneLog in as root.Date Fri Sep 5 A:£ ºWhere UTC refers to the currently used time system for world standard Time , also called World coordination Time . The English name is coordinated Universal time and the French name
Linux ntp time server configuration tutorial, ntp server configuration
Network Time Protocol (NTP) is also a new test requirement for RHCE. During study, I also reviewed how to set the Linux Time. Now I will share it with you.
It is not difficult
Linux/unix-time timestamp processing conversion functionThe time function under LinuxWe can often use time in programming, such as getting the system time (to get the system's year, month, day, hour, minute, second, week, etc.), or to do something
1. Adjust database server timeBecause the app shook a shake activity found out of date 15 minutes, but also can continue to shake, the problem is that the database server time than the application server time is quite 18 minutes, and the app is the
Function category:1. Set the time: settimeofday, tzset2. Get time: time, ftime, gettimeofday3. Time Format Conversion: mktime, strftime; gmtime, localtime; asctime, ctime4. Others: Clock, difftime
Asctime: represents the time and date in string
//-------------------------------------------------------------//
Asctime (representing time and date in string format)
#include
Defining functions
char * asctime (const struct TM * timeptr);Function description
asctime () converts the
First, the Linux common time correlation function-asctime,ctime,getttimeofday,gmtime,localtime,mktime,settimeofday,timeAsctime: Converting dates to stringsCTime: Converts a number of seconds into a stringGettimeofday: Gets the time and date based on
precise timing in microseconds
Long Long l1,l2,l3;
Timeval TV1;
Take a Time
Gettimeofday (&tv,null);
L1 = tv.tv_sec*1000*1000 + tv.tv_usec;
Execute some code, such as algorithm 1 ...
Second time taken
Gettimeofday (&tv,null);
L2 = tv.tv_sec*1000*1
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.